package com.gitee.wsl.mathematics.matrix.ext

import com.gitee.wsl.mathematics.matrix.Matrix
import com.gitee.wsl.mathematics.vector.ext.norm


/**
 * 范数
 * @param n1 阶数
 */
/*fun <T:Number> Matrix<T, *, *>.norm(n1: Int = 2) =
    when (n1) {
        -1   -> m.map { it.norm(1) }.max()
        1    -> n.map { it.norm(1) }.max()
        2    -> (transpose * this).eigen().firstOrNull()?.first?.let(::sqrt)
        else -> throw UnsupportedOperationException("please invoke length(-1) for infinite length")
    } ?: Double.NaN*/

/**
 * 条件数
 * @param n 阶数
 */
/*
fun <T:Number> Matrix<T, *, *>.cond(n: Int = 2): T {
    assertSquare()
    return norm(n) * inverse.norm(n)
}*/
